package demo1;

public class Test {
    public static void test1(Animal animal){
        animal.eat();
    }
    public static void test2(IRunning iRunning){
        iRunning.run();
    }public static void test3(IFlying iflying){
        iflying.fly();
    }public static void test4(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void main(String[] args){
        Brid brid = new Brid("小鸟",2);
        Dog dog = new Dog("小狗",5);

        test1(brid);
        test1(dog);

        test2(new Robot());
        test2(dog);
        test2(brid);

    }
}
